import {Component, EventEmitter, Input, OnInit, Output, ViewEncapsulation} from '@angular/core';

interface Option {
  circle?: boolean;
  icon?: string;
  width?: number;
  height?: number;
  fontSize?: number;
  color?: string;
}

const ICONS: Array<string> = [
  "\ue001", "\ue002", "\ue003", "\ue004", "\ue005", "\ue006", "\ue007", "\ue002", "\ue003", "\ue004", "\ue005", "\ue006", "\ue007", "\ue008", "\ue009", "\ue010", "\ue011", "\ue012", "\ue013", "\ue014", "\ue015", "\ue016", "\ue017", "\ue018", "\ue019", "\ue020", "\ue021", "\ue022", "\ue023", "\ue024", "\ue025", "\ue026", "\ue027", "\ue028", "\ue029", "\ue030", "\ue031", "\ue032", "\ue033", "\ue034", "\ue035", "\ue036", "\ue037", "\ue038", "\ue039", "\ue040", "\ue041", "\ue042", "\ue043", "\ue044", "\ue045", "\ue046", "\ue047", "\ue048", "\ue049", "\ue050", "\ue051", "\ue052", "\ue053", "\ue054", "\ue055", "\ue056", "\ue057", "\ue058", "\ue059", "\ue060", "\ue061", "\ue062", "\ue063", "\ue064", "\ue065", "\ue066", "\ue067", "\ue068", "\ue069", "\ue070", "\ue071", "\ue072", "\ue073", "\ue074", "\ue075", "\ue076", "\ue077", "\ue078", "\ue079", "\ue080", "\ue081", "\ue082", "\ue083", "\ue084", "\ue085", "\ue086", "\ue087", "\ue088", "\ue089", "\ue090", "\ue091", "\ue092", "\ue093", "\ue094", "\ue095", "\ue096", "\ue097", "\ue098", "\ue099", "\ue100", "\ue101", "\ue102", "\ue103", "\ue104", "\ue105", "\ue106", "\ue107", "\ue108", "\ue109", "\ue110", "\ue111", "\ue112", "\ue113", "\ue114", "\ue115", "\ue116", "\ue117", "\ue118", "\ue119", "\ue120", "\ue121", "\ue122", "\ue123", "\ue124", "\ue125", "\ue126", "\ue127", "\ue128", "\ue129", "\ue130", "\ue131", "\ue132", "\ue133", "\ue134", "\ue135", "\ue136", "\ue137", "\ue138", "\ue139", "\ue140", "\ue141", "\ue142", "\ue143", "\ue144", "\ue145", "\ue146", "\ue147", "\ue148", "\ue149", "\ue150", "\ue151", "\ue152", "\ue153", "\ue154", "\ue155", "\ue156", "\ue157", "\ue158", "\ue159", "\ue160", "\ue161", "\ue162", "\ue163", "\ue164", "\ue165", "\ue166", "\ue167", "\ue168", "\ue169", "\ue170", "\ue171", "\ue172", "\ue173", "\ue174", "\ue175", "\ue176", "\ue177", "\ue178", "\ue179", "\ue180", "\ue181", "\ue182", "\ue183", "\ue184", "\ue185"
]

@Component({
  selector: 'ss-platform-appicon',
  templateUrl: './appicon.component.html',
  styleUrls: ['./appicon.component.scss'],
  host: {class: "ss-platform-appicon-wraper"},
  encapsulation: ViewEncapsulation.None
})
export class AppiconComponent implements OnInit {

  @Input("ss-option")
  option: Option = {};

  ICONS = ICONS;

  @Output()
  change: EventEmitter<any> = new EventEmitter()

  constructor() {
  }

  ngOnInit(): void {
    if (!this.option.width) {
      this.option.width = 32;
    }
    if (!this.option.height) {
      this.option.height = 32;
    }
  }

}
